<#include "./segment/copyright.ftl">

package ${cfg.package}.${cfg.moduleName}.api.service;

import lombok.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import ${cfg.criteriaPackageName}.V2${entity}Criteria;
import ${cfg.entityPackageName}.V2${entity};
import vip.isass.core.structure.service.IV2Service;
import vip.isass.core.structure.service.IV2ServiceManager;

import java.util.List;

/**
 * <p>
 * <#if table.comment??>${table.comment}<#else>${table.name}</#if> 服务接口
 * </p>
 *
 * @author ${author}
 */
public interface ${table.serviceName} extends IV2Service<V2${entity}, V2${entity}Criteria> {

    String URI_FIRST_PART = "${cfg.controllerPrefix}/${entity?uncap_first}";

    // region 增

    String ADD_URI = URI_FIRST_PART + ADD_URI_SECOND_PART;
    String ADD_CMD = ADD_OPERATOR + " " + ADD_URI;

    String ADD_BATCH_URI = URI_FIRST_PART + ADD_BATCH_URI_SECOND_PART;
    String ADD_BATCH_CMD = ADD_BATCH_OPERATOR + " " + ADD_BATCH_URI;

    String ADD_BATCH_BY_BATCH_SIZE_URI = URI_FIRST_PART + ADD_BATCH_BY_BATCH_SIZE_URI_SECOND_PART;
    String ADD_BATCH_BY_BATCH_SIZE_CMD = ADD_BATCH_BY_BATCH_SIZE_OPERATOR + " " + ADD_BATCH_BY_BATCH_SIZE_URI;

    String ADD_IF_ABSENT_BY_CRITERIA_URI = URI_FIRST_PART + ADD_IF_ABSENT_BY_CRITERIA_URI_SECOND_PART;
    String ADD_IF_ABSENT_BY_CRITERIA_CMD = ADD_IF_ABSENT_BY_CRITERIA_OPERATOR + " " + ADD_IF_ABSENT_BY_CRITERIA_URI;

    String ADD_IF_ABSENT_BY_COLUMNS_URI = URI_FIRST_PART + ADD_IF_ABSENT_BY_COLUMNS_URI_SECOND_PART;
    String ADD_IF_ABSENT_BY_COLUMNS_CMD = ADD_IF_ABSENT_BY_COLUMNS_OPERATOR + " " + ADD_IF_ABSENT_BY_COLUMNS_URI;

    String ADD_BATCH_IF_ABSENT_BY_CRITERIA_URI = URI_FIRST_PART + ADD_BATCH_IF_ABSENT_BY_CRITERIA_URI_SECOND_PART;
    String ADD_BATCH_IF_ABSENT_BY_CRITERIA_CMD = ADD_BATCH_IF_ABSENT_BY_CRITERIA_OPERATOR + " " + ADD_BATCH_IF_ABSENT_BY_CRITERIA_URI;

    String ADD_BATCH_IF_ABSENT_BY_COLUMNS_URI = URI_FIRST_PART + ADD_BATCH_IF_ABSENT_BY_COLUMNS_URI_SECOND_PART;
    String ADD_BATCH_IF_ABSENT_BY_COLUMNS_CMD = ADD_BATCH_IF_ABSENT_BY_COLUMNS_OPERATOR + " " + ADD_BATCH_IF_ABSENT_BY_COLUMNS_URI;

    String ADD_OR_UPDATE_BY_COLUMNS_URI = URI_FIRST_PART + ADD_OR_UPDATE_BY_COLUMNS_URI_SECOND_PART;
    String ADD_OR_UPDATE_BY_COLUMNS_CMD = ADD_OR_UPDATE_BY_COLUMNS_OPERATOR + " " + ADD_OR_UPDATE_BY_COLUMNS_URI;

    String ADD_OR_UPDATE_BATCH_BY_COLUMNS_URI = URI_FIRST_PART + ADD_OR_UPDATE_BATCH_BY_COLUMNS_URI_SECOND_PART;
    String ADD_OR_UPDATE_BATCH_BY_COLUMNS_CMD = ADD_OR_UPDATE_BATCH_BY_COLUMNS_OPERATOR + " " + ADD_OR_UPDATE_BATCH_BY_COLUMNS_URI;

    String ADD_OR_UPDATE_BY_CRITERIA_URI = URI_FIRST_PART + ADD_OR_UPDATE_BY_CRITERIA_URI_SECOND_PART;
    String ADD_OR_UPDATE_BY_CRITERIA_CMD = ADD_OR_UPDATE_BY_CRITERIA_OPERATOR + " " + ADD_OR_UPDATE_BY_CRITERIA_URI;

    // endregion

    //  region 删

    String DELETE_BY_ID_URI = URI_FIRST_PART + DELETE_BY_ID_URI_SECOND_PART;
    String DELETE_BY_ID_CMD = DELETE_BY_ID_OPERATOR + " " + DELETE_BY_ID_URI;

    String DELETE_BY_IDS_URI = URI_FIRST_PART + DELETE_BY_IDS_URI_SECOND_PART;
    String DELETE_BY_IDS_CMD = DELETE_BY_IDS_OPERATOR + " " + DELETE_BY_IDS_URI;

    String DELETE_BY_CRITERIA_URI = URI_FIRST_PART + DELETE_BY_CRITERIA_URI_SECOND_PART;
    String DELETE_BY_CRITERIA_CMD = DELETE_BY_CRITERIA_OPERATOR + " " + DELETE_BY_CRITERIA_URI;

    // endregion

    // region 改

    String UPDATE_BY_ID_URI = URI_FIRST_PART + UPDATE_BY_ID_URI_SECOND_PART;
    String UPDATE_BY_ID_CMD = UPDATE_BY_ID_OPERATOR + " " + UPDATE_BY_ID_URI;

    String UPDATE_ALL_COLUMNS_BY_ID_URI = URI_FIRST_PART + UPDATE_ALL_COLUMNS_BY_ID_URI_SECOND_PART;
    String UPDATE_ALL_COLUMNS_BY_ID_CMD = UPDATE_ALL_COLUMNS_BY_ID_OPERATOR + " " + UPDATE_ALL_COLUMNS_BY_ID_URI;

    String UPDATE_BY_ID_OR_EXCEPTION_URI = URI_FIRST_PART + UPDATE_BY_ID_OR_EXCEPTION_URI_SECOND_PART;
    String UPDATE_BY_ID_OR_EXCEPTION_CMD = UPDATE_BY_ID_OR_EXCEPTION_OPERATOR + " " + UPDATE_BY_ID_OR_EXCEPTION_URI;

    String UPDATE_BY_CRITERIA_URI = URI_FIRST_PART + UPDATE_BY_CRITERIA_URI_SECOND_PART;
    String UPDATE_BY_CRITERIA_CMD = UPDATE_BY_CRITERIA_OPERATOR + " " + UPDATE_BY_CRITERIA_URI;

    String UPDATE_BY_CRITERIA_OR_EXCEPTION_URI = URI_FIRST_PART + UPDATE_BY_CRITERIA_OR_EXCEPTION_URI_SECOND_PART;
    String UPDATE_BY_CRITERIA_OR_EXCEPTION_CMD = UPDATE_BY_CRITERIA_OR_EXCEPTION_OPERATOR + " " + UPDATE_BY_CRITERIA_OR_EXCEPTION_URI;

    // endregion

    //  region 查

    String GET_BY_ID_URI = URI_FIRST_PART + GET_BY_ID_URI_SECOND_PART;
    String GET_BY_ID_CMD = GET_BY_ID_OPERATOR + " " + GET_BY_ID_URI;

    String GET_BY_ID_OR_EXCEPTION_URI = URI_FIRST_PART + GET_BY_ID_OR_EXCEPTION_URI_SECOND_PART;
    String GET_BY_ID_OR_EXCEPTION_CMD = GET_BY_ID_OR_EXCEPTION_OPERATOR + " " + GET_BY_ID_OR_EXCEPTION_URI;

    String GET_BY_CRITERIA_URI = URI_FIRST_PART + GET_BY_CRITERIA_URI_SECOND_PART;
    String GET_BY_CRITERIA_CMD = GET_BY_CRITERIA_OPERATOR + " " + GET_BY_CRITERIA_URI;

    String GET_BY_CRITERIA_OR_WARN_URI = URI_FIRST_PART + GET_BY_CRITERIA_OR_WARN_URI_SECOND_PART;
    String GET_BY_CRITERIA_OR_WARN_CMD = GET_BY_CRITERIA_OR_WARN_OPERATOR + " " + GET_BY_CRITERIA_OR_WARN_URI;

    String GET_BY_CRITERIA_OR_EXCEPTION_URI = URI_FIRST_PART + GET_BY_CRITERIA_OR_EXCEPTION_URI_SECOND_PART;
    String GET_BY_CRITERIA_OR_EXCEPTION_CMD = GET_BY_CRITERIA_OR_EXCEPTION_OPERATOR + " " + GET_BY_CRITERIA_OR_EXCEPTION_URI;

    String FIND_BY_CRITERIA_URI = URI_FIRST_PART + FIND_BY_CRITERIA_URI_SECOND_PART;
    String FIND_BY_CRITERIA_CMD = FIND_BY_CRITERIA_OPERATOR + " " + FIND_BY_CRITERIA_URI;

    String FIND_PAGE_BY_CRITERIA_URI = URI_FIRST_PART + FIND_PAGE_BY_CRITERIA_URI_SECOND_PART;
    String FIND_PAGE_BY_CRITERIA_CMD = FIND_PAGE_BY_CRITERIA_OPERATOR + " " + FIND_PAGE_BY_CRITERIA_URI;

    String FIND_ALL_URI = URI_FIRST_PART + FIND_ALL_URI_SECOND_PART;
    String FIND_ALL_CMD = FIND_ALL_OPERATOR + " " + FIND_ALL_URI;

    String COUNT_BY_CRITERIA_URI = URI_FIRST_PART + COUNT_BY_CRITERIA_URI_SECOND_PART;
    String COUNT_BY_CRITERIA_CMD = COUNT_BY_CRITERIA_OPERATOR + " " + COUNT_BY_CRITERIA_URI;

    String COUNT_ALL_URI = URI_FIRST_PART + COUNT_ALL_URI_SECOND_PART;
    String COUNT_ALL_CMD = COUNT_ALL_OPERATOR + " " + COUNT_ALL_URI;

    String IS_PRESENT_BY_ID_URI = URI_FIRST_PART + IS_PRESENT_BY_ID_URI_SECOND_PART;
    String IS_PRESENT_BY_ID_CMD = IS_PRESENT_BY_ID_OPERATOR + " " + IS_PRESENT_BY_ID_URI;

    String IS_PRESENT_BY_COLUMN_URI = URI_FIRST_PART + IS_PRESENT_BY_COLUMN_URI_SECOND_PART;
    String IS_PRESENT_BY_COLUMN_CMD = IS_PRESENT_BY_COLUMN_OPERATOR + " " + IS_PRESENT_BY_COLUMN_URI;

    String IS_PRESENT_BY_CRITERIA_URI = URI_FIRST_PART + IS_PRESENT_BY_CRITERIA_URI_SECOND_PART;
    String IS_PRESENT_BY_CRITERIA_CMD = IS_PRESENT_BY_CRITERIA_OPERATOR + " " + IS_PRESENT_BY_CRITERIA_URI;

    String IS_ABSENT_BY_COLUMN_URI = URI_FIRST_PART + IS_ABSENT_BY_COLUMN_URI_SECOND_PART;
    String IS_ABSENT_BY_COLUMN_CMD = IS_ABSENT_BY_COLUMN_OPERATOR + " " + IS_ABSENT_BY_COLUMN_URI;

    String IS_ABSENT_BY_CRITERIA_URI = URI_FIRST_PART + IS_ABSENT_BY_CRITERIA_URI_SECOND_PART;
    String IS_ABSENT_BY_CRITERIA_CMD = IS_ABSENT_BY_CRITERIA_OPERATOR + " " + IS_ABSENT_BY_CRITERIA_URI;

    String EXCEPTION_IF_PRESENT_BY_CRITERIA_URI = URI_FIRST_PART + EXCEPTION_IF_PRESENT_BY_CRITERIA_URI_SECOND_PART;
    String EXCEPTION_IF_PRESENT_BY_CRITERIA_CMD = EXCEPTION_IF_PRESENT_BY_CRITERIA_OPERATOR + " " + EXCEPTION_IF_PRESENT_BY_CRITERIA_URI;

    String EXCEPTION_IF_ABSENT_BY_CRITERIA_URI = URI_FIRST_PART + EXCEPTION_IF_ABSENT_BY_CRITERIA_URI_SECOND_PART;
    String EXCEPTION_IF_ABSENT_BY_CRITERIA_CMD = EXCEPTION_IF_ABSENT_BY_CRITERIA_OPERATOR + " " + EXCEPTION_IF_ABSENT_BY_CRITERIA_URI;

    // endregion

    // region 新业务方法

    // endregion

    @Primary
    @Service
    class V2${table.serviceImplName}Manager implements
            ${table.serviceName},
            IV2ServiceManager<V2${entity}, V2${entity}Criteria, ${table.serviceName}> {

        @Getter
        @Autowired(required = false)
        private List<${table.serviceName}> services;

        // region 新业务方法

        // endregion

    }

}